﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Pheonix.Fashionzoomer.DAL;
using Pheonix.Fashionzoomer.Entity.SqlServer2000;
using System.Collections.Generic;
using System.Collections;


/// <summary>
/// Summary description for MessageManager
/// </summary>
public class MessageManager
{
	public MessageManager()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    /// <summary>
    /// 
    /// </summary>
    /// <param name="ReceiverUserId"></param>
    /// <returns></returns>
    public static DataTable GetMessageOfReceiver(int ReceiverUserId)
    {
        return CustomCommand.GetMessageByReceiverUserId(ReceiverUserId);
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="MessageIdList"></param>
    public static void DeleteMessages(List<int> MessageIdList)
    { 
        foreach(int mesaageID in MessageIdList)
        {
            Message.DeleteMessage(mesaageID);
        }
        
    }
    public static Message GetMsgByMsgId(int id)
    {
        Message message = Message.GetMessageById(id);
        return message;
    }
    public static DataTable GetAllMessage()
    {
        return CustomCommand.GetAllMessage();
    }

    public static DataTable GetMessageBySearchKey(string searchKey)
    {
        return CustomCommand.GetMessageBySearchKey(searchKey);
    }
    
}
